﻿using System.Collections.Generic;
using CkSoftware.GroupMe.Sdk.Core.Dao;
using CkSoftware.GroupMe.Sdk.Messaging.Commands;
using Newtonsoft.Json;

namespace CkSoftware.GroupMe.Sdk.Messaging.Dao
{
	/// <summary>
	/// The result data for the <see cref="GroupMessagesIndexCommand" />.
	/// </summary>
	public class MessagesIndexData
	{
		/// <summary>
		/// The messages newly available.
		/// </summary>
		[JsonProperty(PropertyName = "messages")]
		public IEnumerable<GroupMeMessageData> Messages { get; set; }

		/// <summary>
		/// This property should not be used, it is just an alias for the Newtonsoft Json Serializer / deserializer.
		/// </summary>
		[JsonProperty(PropertyName = "direct_messages")]
		// ReSharper disable UnusedMember.Local
		private IEnumerable<GroupMeMessageData> DirectMessages
		// ReSharper restore UnusedMember.Local
		{
			get { return Messages; }
			set { Messages = value; }
		}

		/// <summary>
		/// The total amount of messages available in this group / direct-messages.
		/// </summary>
		[JsonProperty(PropertyName = "count")]
		public int TotalMessagesCount { get; set; }
	}
}